home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / unix / ch10 / 10fig12.wrl < prev   
Text File  |  1996-09-22  |  1KB  |  51 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright 1997 By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. Group {
  6.     children [
  7.     # Moving box
  8.         DEF Cube Transform {
  9.             children Shape {
  10.                 appearance Appearance {
  11.                     material Material {
  12.                         diffuseColor 1.0 1.0 0.0
  13.                     }
  14.                 }
  15.                 geometry Box { size 1.0 1.0 1.0 }
  16.             }
  17.         },
  18.     # Animation clock
  19.         DEF Clock TimeSensor {
  20.             cycleInterval 4.0
  21.             loop TRUE
  22.         },
  23.     # Animation controller
  24.         DEF CubeController ScalarInterpolator {
  25.             key      [ 0.0, 0.5, 1.0 ]
  26.             keyValue [ 0.0, 1.0, 0.0 ]
  27.         },
  28.     # Animation path
  29.         DEF CubePath PositionInterpolator {
  30.             key [
  31.                 0.00, 0.11, 0.17, 0.22,
  32.                 0.33, 0.44, 0.50, 0.55,
  33.                 0.66, 0.77, 0.83, 0.88,
  34.                 0.99
  35.             ]
  36.             keyValue [
  37.                 0.0 0.0  0.0,  1.0 1.96 1.0,
  38.                 1.5 2.21 1.5,  2.0 1.96 2.0,
  39.                 3.0 0.0  3.0,  2.0 1.96 3.0,
  40.                 1.5 2.21 3.0,  1.0 1.96 3.0,
  41.                 0.0 0.0  3.0,  0.0 1.96 2.0,
  42.                 0.0 2.21 1.5,  0.0 1.96 1.0,
  43.                 0.0 0.0  0.0
  44.             ]
  45.         }
  46.     ]
  47. }
  48. ROUTE Clock.fraction_changed       TO CubeController.set_fraction
  49. ROUTE CubeController.value_changed TO CubePath.set_fraction
  50. ROUTE CubePath.value_changed       TO Cube.set_translation
  51.